﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Reflection;
using Crystal.libs;
using System.Diagnostics;
using LevelEditor.ViewModel;

namespace LevelEditor
{
    public partial class Editor : Window
    {
        private LevelEditorViewModel ViewModel;

        public Editor()
        {
            InitializeComponent();
            this.DataContext = ViewModel = new LevelEditorViewModel();
        }
        
        private void GraphicsDeviceControl_LoadContent(object sender, WpfHostedXna.GraphicsDeviceEventArgs e)
        {
            ViewModel.Load(e);
        }
        private void GraphicsDeviceControl_RenderXna(object sender, WpfHostedXna.GraphicsDeviceEventArgs e)
        {
            ViewModel.Render(e);
        }
        private void GraphicsDeviceControl_HwndLButtonDown(object sender, WpfHostedXna.HwndMouseEventArgs e)
        {
            ViewModel.MouseDown(e);
        }
        private void GraphicsDeviceControl_HwndLButtonUp(object sender, WpfHostedXna.HwndMouseEventArgs e)
        {
            ViewModel.MouseUp(e);
        }
        private void GraphicsDeviceControl_HwndMButtonDblClick(object sender, WpfHostedXna.HwndMouseEventArgs e)
        {
            ViewModel.DoubleClick(e);
        }
    }
}


